package mc

import (
	"gitee.com/dreamwood/ez-go/db/mgo"
)

const (
	DepartmentEventNew          = "mes.DepartmentNew"
	DepartmentEventBeforeCreate = "mes.DepartmentBeforeCreate"
	DepartmentEventBeforeUpdate = "mes.DepartmentBeforeUpdate"
	DepartmentEventBeforeSave   = "mes.DepartmentBeforeCreate mes.DepartmentBeforeUpdate"
	DepartmentEventAfterCreate  = "mes.DepartmentAfterCreate"
	DepartmentEventAfterUpdate  = "mes.DepartmentAfterUpdate"
	DepartmentEventAfterSave    = "mes.DepartmentAfterCreate mes.DepartmentAfterUpdate"
	DepartmentEventDelete       = "mes.DepartmentDelete"

	DepartmentAccessControlEvent = "mes.DepartmentAccessControl"
)

func GetDepartmentConfig() *mgo.DocConfig {
	return Department_Config
}

var Department_Config *mgo.DocConfig

func init() {
	Department_Config = NewDepartmentConfig()
}

func NewDepartmentConfig() *mgo.DocConfig {
	return &mgo.DocConfig{
		ContainerKey: "mes.Department",
		Fields: []string{
			"name", "code",
		},
		RelationFields:  []string{},
		RelationConfigs: map[string]*mgo.DocRelation{},
		FieldFilter: map[string]*mgo.DocFieldFilter{
			"default": {
				Select: []string{},
				Omit:   []string{},
			},
		},
	}
}
